{% extends "admin/base_site.html" %}
{% load admin_urls static admin_modify django_vite %}

{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% static 'js/i18n/en-US.js' %}"></script>
{% vite_asset 'js/blocklist_blocklistsubmission.js' %}
{{ media }}
{% endblock %}

{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "css/admin/blocklist_blocklistsubmission.css" %}">
  {% endblock %}

{% block coltype %}colM{% endblock %}

{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">Home</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; {% if has_view_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
&rsaquo; {{ original|truncatewords:"18" }}
</div>
{% endblock %}

{% block content %}<div id="content-main">
  <form action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>
  {% csrf_token %}
  {{ adminform.form.action }}
  {{ adminform.form.input_guids }}
  {% if not adminform.form.existing_guids|length == 0 or not adminform.form.invalid_guids|length == 0 %}
  <div>
    <div class="form-row horizontal-grid">
      <div>
        <h3>{{ adminform.form.existing_guids|length }} Add-on GUIDs already completely blocked:</h3>
        <ul class="guid_list field-existing-guids">
          {% for guid in adminform.form.existing_guids %}
          <li>{{ guid }}</li>
          {% endfor %}
        </ul>
      </div>
      <div>
        <h3>{{ adminform.form.invalid_guids|length }} Add-on GUIDs were not found:</h3>
        <ul class="guid_list">
          {% for guid in adminform.form.invalid_guids %}
          <li>{{ guid }}</li>
          {% endfor %}
        </ul>
      </div>
    </div>
  </div>
  {% endif %}
  <fieldset class="module aligned">
    <h2>{{ fieldsets.2.0 }}</h2>
    <div class="form-row field-blocks-to-add">
      <div>
        {{ adminform.form.changed_version_ids }}
      </div>
      {{ adminform.form.changed_version_ids.errors }}
    </div>
    {% if block_history %}
    <div class="form-row field-block_history">
      <label>Block History:</label>
      <div class="readonly">{{ block_history }}</div>
    </div>
    {% endif %}
    {% if adminform.form.non_field_errors %}
    <div class="form-row">
      {{ adminform.form.non_field_errors }}
    </div>
    {% endif %}
    <div class="form-row field-block_type">
      {{ adminform.form.block_type.errors }}
      {{ adminform.form.block_type.label_tag }}
      {{ adminform.form.block_type }}
      <p class="help">{{ adminform.form.block_type.help_text }}</p>
    </div>
    <div class="form-row">
      {{ adminform.form.disable_addon.errors }}
      {{ adminform.form.disable_addon.label_tag }}
      {{ adminform.form.disable_addon }}
      <p class="help">{{ adminform.form.disable_addon.help_text }}</p>
    </div>
    <div class="form-row">
      {{ adminform.form.update_url_value }}
      {{ adminform.form.update_url_value.errors }}
      {{ adminform.form.url.errors }}
      {{ adminform.form.url.label_tag }}
      {{ adminform.form.url }}
      <p class="help">{{ adminform.form.url.help_text }}</p>
    </div>
    <div class="form-row">
      {{ adminform.form.update_reason_value }}
      {{ adminform.form.canned_reasons.label_tag }}
      {{ adminform.form.canned_reasons }}
      {{ adminform.form.canned_reasons.errors }}
      {{ adminform.form.update_reason_value.errors }}
      {{ adminform.form.reason.errors }}
      {{ adminform.form.reason.label_tag }}
      {{ adminform.form.reason }}
      <p class="help">{{ adminform.form.reason.help_text }}</p>
    </div>
    <div class="form-row">
      {{ adminform.form.delay_days.errors }}
      {{ adminform.form.delayed_until.errors }}
      {{ adminform.form.delay_days.label_tag }}
      {{ adminform.form.delay_days }}
      <p class="help">{{ adminform.form.delay_days.help_text }}</p>
    </div>
    {% block submit_buttons_bottom %}
    <div class="submit-row">
      <input type="submit" value="Save" class="default" name="_save">
      <input type="submit" value="Save and add more" name="_addanother">
    </div>
    {% endblock %}
  </fieldset>
  </form>
</div>
{% endblock %}
